home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / pgtray3x / PGTRAY3X.ZIP / Setup.exe / PGTRAY95.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-27  |  10.6 KB  |  283 lines

  1. //----------------------------------------------------------------------------
  2. // PGTray95.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: PGTray95.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef PGTray95HPP
  6. #define PGTray95HPP
  7. //----------------------------------------------------------------------------
  8. #include <PGAppWnd.hpp>
  9. #include <Menus.hpp>
  10. #include <ShellAPI.hpp>
  11. #include <IniFiles.hpp>
  12. #include <Dialogs.hpp>
  13. #include <ExtCtrls.hpp>
  14. #include <Forms.hpp>
  15. #include <Controls.hpp>
  16. #include <Graphics.hpp>
  17. #include <Classes.hpp>
  18. #include <Messages.hpp>
  19. #include <Windows.hpp>
  20. #include <SysUtils.hpp>
  21. #include <System.hpp>
  22. namespace Pgtray95
  23. {
  24. //-- type declarations -------------------------------------------------------
  25. enum TPGTrayIconAnimationOptions { aoIconsInExe, aoIconsAreFiles };
  26.  
  27. class __declspec(delphiclass) TPGTrayIconAnimation;
  28. class __declspec(delphiclass) TPGTimerItem;
  29. class __declspec(delphiclass) TPGTimerManager;
  30. typedef int TPGTimerInterval;
  31.  
  32. class __declspec(pascalimplementation) TPGTimerManager : public Classes::TComponent
  33. {
  34.     typedef Classes::TComponent inherited;
  35.     
  36. protected:
  37.     bool FEnabled;
  38.     Classes::TList* TimerItems;
  39.     void __fastcall SetEnabled(bool p0);
  40.     void __fastcall DoTimeouts(System::TObject* p0);
  41.     
  42. public:
  43.     Extctrls::TTimer* Timer;
  44.     __fastcall virtual TPGTimerManager(Classes::TComponent* p0);
  45.     __fastcall virtual ~TPGTimerManager(void);
  46.     TPGTimerItem* __fastcall AddTimer(bool p0, TPGTimerInterval p1, Classes::TNotifyEvent p2);
  47.     void __fastcall DeleteTimer(int p0);
  48.     TPGTimerItem* __fastcall Timers(int p0);
  49.     int __fastcall TimerCount(void);
  50.     void __fastcall RefreshInterval(void);
  51.     
  52. __published:
  53.     __property bool Enabled = {read=FEnabled, write=SetEnabled, nodefault};
  54. };
  55.  
  56. class __declspec(pascalimplementation) TPGTimerItem : public Classes::TComponent
  57. {
  58.     typedef Classes::TComponent inherited;
  59.     
  60. protected:
  61.     TPGTimerManager* TimerManager;
  62.     TPGTimerInterval FInterval;
  63.     bool FEnabled;
  64.     Classes::TNotifyEvent OnTimer;
  65.     void __fastcall SetEnabled(bool p0);
  66.     void __fastcall SetInterval(TPGTimerInterval p0);
  67.     
  68. public:
  69.     double LastTickCount;
  70.     long Tag;
  71.     __fastcall virtual TPGTimerItem(Classes::TComponent* p0);
  72.     bool __fastcall ShouldTimeout(void);
  73.     void __fastcall TimeOut(void);
  74.     
  75. __published:
  76.     __property bool Enabled = {read=FEnabled, write=SetEnabled, nodefault};
  77.     __property TPGTimerInterval Interval = {read=FInterval, write=SetInterval, nodefault};
  78. public:
  79.     /* TComponent.Destroy */ __fastcall virtual ~TPGTimerItem(void) { }
  80.     
  81. };
  82.  
  83. class __declspec(delphiclass) TPGTrayIcon95;
  84. enum TPGTrayIconState { tsEnabled, tsDisabled, tsAnimated };
  85.  
  86. enum TPGTrayIconOption { toMinimizeToTray, toUnclutterDelphi1TaskBar };
  87.  
  88. typedef Set<TPGTrayIconOption, toMinimizeToTray, toUnclutterDelphi1TaskBar>  TPGTrayIconOptions;
  89.  
  90. typedef void __fastcall (__closure *TPGTrayIconStateChangingEvent)(System::TObject* Sender, TPGTrayIconState 
  91.     &NewState);
  92.  
  93. struct PGNOTIFYICONDATA
  94. {
  95.     long cbSize;
  96.     long Wnd;
  97.     long uID;
  98.     long uFlags;
  99.     long uCallbackMessage;
  100.     long hIcon;
  101.     char szTip[64];
  102. } ;
  103.  
  104. class __declspec(delphiclass) TPGTrayIconMsgWindow;
  105. class __declspec(pascalimplementation) TPGTrayIconMsgWindow : public Classes::TComponent
  106. {
  107.     typedef Classes::TComponent inherited;
  108.     
  109. protected:
  110.     TMouseButton ClickedMouseButton;
  111.     TPGTrayIcon95* TrayIcon;
  112.     bool DoubleClickHasOccurred;
  113.     TPGTimerItem* WaitForClickEventTimer;
  114.     TPGTimerItem* MouseMoveTimer;
  115.     tagPOINT ptMousePosition;
  116.     bool AlreadyFiredMouseEnterEvent;
  117.     bool HitTrayIcon;
  118.     MESSAGE void __fastcall TrayIconCallback(Messages::TMessage &PGTray95_);
  119.     void __fastcall StartWaitingForDoubleClick(void);
  120.     void __fastcall DoClickEventAsynchronously(TPGTimerInterval p0);
  121.     void __fastcall DoneWaitingForDoubleClick(System::TObject* p0);
  122.     void __fastcall StartTrackingMouseMovement(const tagPOINT &PGTray95_);
  123.     void __fastcall StopTrackingMouseMovement(void);
  124.     void __fastcall TrackMouseMovement(System::TObject* p0);
  125.     
  126. public:
  127.     __fastcall virtual TPGTrayIconMsgWindow(Classes::TComponent* p0);
  128.     __fastcall virtual ~TPGTrayIconMsgWindow(void);
  129. };
  130.  
  131. class __declspec(pascalimplementation) TPGTrayIcon95 : public Classes::TComponent
  132. {
  133.     typedef Classes::TComponent inherited;
  134.     
  135. protected:
  136.     TPGTrayIconAnimation* FAnimation;
  137.     bool FActive;
  138.     bool FAutoPopup;
  139.     Graphics::TIcon* FDisabledIcon;
  140.     Forms::TForm* FForm;
  141.     int FHandle;
  142.     System::AnsiString FHint;
  143.     Graphics::TIcon* FIcon;
  144.     TPGTrayIconState FState;
  145.     TPGTrayIconOptions FOptions;
  146.     Classes::TNotifyEvent FOnAnimation;
  147.     Classes::TNotifyEvent FOnClick;
  148.     Classes::TNotifyEvent FOnDblClick;
  149.     Controls::TMouseMoveEvent FOnMouseMove;
  150.     Controls::TMouseMoveEvent FOnMouseEnter;
  151.     Controls::TMouseMoveEvent FOnMouseExit;
  152.     TPGTrayIconStateChangingEvent FOnStateChanging;
  153.     Classes::TNotifyEvent FOnAppMinimize;
  154.     Classes::TNotifyEvent FOnAppRestore;
  155.     Menus::TPopupMenu* FPopupMenu;
  156.     bool FShowHint;
  157.     Graphics::TIcon* CurrentIcon;
  158.     PGNOTIFYICONDATA tnd;
  159.     Classes::TNotifyEvent PostedEvent;
  160.     System::AnsiString __fastcall GetHint(void);
  161.     int __fastcall GetHandle(void);
  162.     Controls::TMouseButton __fastcall GetClickedMouseButton(void);
  163.     void __fastcall SetActive(bool p0);
  164.     void __fastcall SetDisabledIcon(Graphics::TIcon* p0);
  165.     void __fastcall SetHint( System::AnsiString p0);
  166.     void __fastcall SetIcon(Graphics::TIcon* p0);
  167.     void __fastcall SetOptions(TPGTrayIconOptions p0);
  168.     void __fastcall SetShowHint(bool p0);
  169.     void __fastcall SetState(TPGTrayIconState p0);
  170.     void __fastcall FireEvent(Classes::TNotifyEvent p0);
  171.     void __fastcall IconChanged(System::TObject* p0);
  172.     void __fastcall LoadAnimationIcon(const int p0);
  173.     void __fastcall LoadCurrentIcon(void);
  174.     virtual void __fastcall Loaded(void);
  175.     void __fastcall ApplicationMinimize(System::TObject* p0);
  176.     void __fastcall ApplicationRestore(System::TObject* p0);
  177.     long __fastcall HIcon32(void);
  178.     
  179. public:
  180.     TPGTrayIconMsgWindow* MessageWindow;
  181.     TPGTimerManager* TimerManager;
  182.     __fastcall virtual TPGTrayIcon95(Classes::TComponent* p0);
  183.     __fastcall virtual ~TPGTrayIcon95(void);
  184.     void __fastcall ShowIcon(void);
  185.     void __fastcall HideIcon(void);
  186.     virtual void __fastcall ShowApplication(void);
  187.     virtual void __fastcall HideApplication(void);
  188.     void __fastcall DoShowApplication(System::TObject* p0);
  189.     void __fastcall DoHideApplication(System::TObject* p0);
  190.     void __fastcall Refresh(void);
  191.     void __fastcall ShowPopupAtCursor(void);
  192.     void __fastcall NotifyShell(long p0);
  193.     void __fastcall PostEvent(Classes::TNotifyEvent p0);
  194.     bool __fastcall ShouldDisplayPopup(void);
  195.     bool __fastcall ShouldDoMouseMove(void);
  196.     bool __fastcall ShouldDoMouseEnterOrMouseExit(void);
  197.     virtual void __fastcall LockScreenUpdates(bool p0);
  198.     __property Controls::TMouseButton ClickedMouseButton = {read=GetClickedMouseButton, nodefault};
  199.     __property int Handle = {read=GetHandle, nodefault};
  200.     __property Forms::TForm* Form = {read=FForm, nodefault};
  201.     
  202. __published:
  203.     __property Graphics::TIcon* Icon = {read=FIcon, write=SetIcon, nodefault};
  204.     __property Graphics::TIcon* DisabledIcon = {read=FDisabledIcon, write=SetDisabledIcon, nodefault};
  205.     __property TPGTrayIconAnimation* Animation = {read=FAnimation, write=FAnimation, nodefault};
  206.     __property bool Active = {read=FActive, write=SetActive, default=0};
  207.     __property bool AutoPopup = {read=FAutoPopup, write=FAutoPopup, default=0};
  208.     __property System::AnsiString Hint = {read=FHint, write=SetHint, nodefault};
  209.     __property Classes::TNotifyEvent OnAnimation = {read=FOnAnimation, write=FOnAnimation};
  210.     __property Classes::TNotifyEvent OnAppMinimize = {read=FOnAppMinimize, write=FOnAppMinimize};
  211.     __property Classes::TNotifyEvent OnAppRestore = {read=FOnAppRestore, write=FOnAppRestore};
  212.     __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
  213.     __property Classes::TNotifyEvent OnDblClick = {read=FOnDblClick, write=FOnDblClick};
  214.     __property Controls::TMouseMoveEvent OnMouseMove = {read=FOnMouseMove, write=FOnMouseMove};
  215.     __property Controls::TMouseMoveEvent OnMouseEnter = {read=FOnMouseEnter, write=FOnMouseEnter};
  216.     __property Controls::TMouseMoveEvent OnMouseExit = {read=FOnMouseExit, write=FOnMouseExit};
  217.     __property TPGTrayIconStateChangingEvent OnStateChanging = {read=FOnStateChanging, write=FOnStateChanging
  218.         };
  219.     __property TPGTrayIconOptions Options = {read=FOptions, write=SetOptions, default=3};
  220.     __property Menus::TPopupMenu* PopupMenu = {read=FPopupMenu, write=FPopupMenu, nodefault};
  221.     __property bool ShowHint = {read=FShowHint, write=SetShowHint, default=1};
  222.     __property TPGTrayIconState State = {read=FState, write=SetState, default=0};
  223. };
  224.  
  225. class __declspec(pascalimplementation) TPGTrayIconAnimation : public Classes::TPersistent
  226. {
  227.     typedef Classes::TPersistent inherited;
  228.     
  229. protected:
  230.     TPGTimerItem* AnimationTimer;
  231.     TPGTrayIcon95* TrayIcon;
  232.     int FIconIndex;
  233.     int FInterval;
  234.     Classes::TStringList* FIcons;
  235.     TPGTrayIconAnimationOptions FOptions;
  236.     void __fastcall SetInterval(int p0);
  237.     void __fastcall SetIcons(Classes::TStringList* p0);
  238.     void __fastcall StartAnimation(void);
  239.     void __fastcall StopAnimation(void);
  240.     void __fastcall AnimationEvent(System::TObject* p0);
  241.     
  242. public:
  243.     __property int IconIndex = {read=FIconIndex, nodefault};
  244.     
  245. __published:
  246.     __property int Interval = {read=FInterval, write=SetInterval, default=1000};
  247.     __property Classes::TStringList* Icons = {read=FIcons, write=SetIcons, nodefault};
  248.     __property TPGTrayIconAnimationOptions Options = {read=FOptions, write=FOptions, default=1};
  249. public:
  250.         
  251.     /* TObject.Create */ __fastcall TPGTrayIconAnimation(void) : Classes::TPersistent() { }
  252.     /* TObject.Destroy */ __fastcall virtual ~TPGTrayIconAnimation(void) { }
  253.     
  254. };
  255.  
  256. typedef PGNOTIFYICONDATA *PPGNOTIFYICONDATA;
  257.  
  258. //-- var, const, procedure ---------------------------------------------------
  259. #define WM_TRAY_CALLBACK (Word)(1124)
  260. #define WM_PGPOSTEVENT (Word)(1125)
  261. #define TRAY_ICON_ID (Byte)(42)
  262. #define PGNIM_ADD (Byte)(0)
  263. #define PGNIM_MODIFY (Byte)(1)
  264. #define PGNIM_DELETE (Byte)(2)
  265. #define PGNIF_MESSAGE (Byte)(1)
  266. #define PGNIF_ICON (Byte)(2)
  267. #define PGNIF_TIP (Byte)(4)
  268. #define NID_MAXTIP (Byte)(63)
  269. #define Animation_Interval (Word)(1000)
  270. extern TPGTimerInterval PGTrayIconDoubleClickTime;
  271. extern void __fastcall Register(void);
  272. extern Classes::TShiftState __fastcall PGShiftState(void);
  273. extern void __fastcall RunTrayApplication(void);
  274. //-- template instantiations -------------------------------------------------
  275. template class TPGTrayIconOptions ;
  276.  
  277. }    /* namespace Pgtray95 */
  278. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  279. using namespace Pgtray95;
  280. #endif
  281. //-- end unit ----------------------------------------------------------------
  282. #endif    // PGTray95
  283.